package com.hnkywl.sts.entity.sys;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.organ.Gsjg;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * 岗位
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-3-2
 * Time: 下午2:33
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="T_SYS_GW")
@Where(clause = "deleted!='1'")
public class Gw extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqGw", allocationSize = 1, sequenceName = "SEQ_SYS_GW")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGw")
    private Long id;

    /**
     * 名称
     */
    private String mc;

    /**
     * 描述
     */
    private String ms;

    /**
     * 入职要求
     */
    private String rzyq;

    /**
     * 排序号
    */
    private Integer pxh;

    /**
     * 员工
     */
    @ManyToMany(fetch = FetchType.LAZY,mappedBy = "ssgwList")
    private List<Yg> ygList;

    /**
     * 公司机构
     */
    @ManyToMany(fetch = FetchType.LAZY,mappedBy = "gsjggwList")
    private List<Gsjg> gsjgList;

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name="T_SYS_GW_JS", joinColumns={@JoinColumn(name="GW_ID")},inverseJoinColumns={@JoinColumn(name="JS_ID")})
    @Where(clause = "deleted!='1'")
    private List<Js> jsList;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getMs() {
        return ms;
    }

    public void setMs(String ms) {
        this.ms = ms;
    }

    public String getRzyq() {
        return rzyq;
    }

    public void setRzyq(String rzyq) {
        this.rzyq = rzyq;
    }

    public Integer getPxh() {
        return pxh;
    }

    public void setPxh(Integer pxh) {
        this.pxh = pxh;
    }

    public List<Yg> getYgList() {
        return ygList;
    }

    public void setYgList(List<Yg> ygList) {
        this.ygList = ygList;
    }

    public List<Js> getJsList() {
        return jsList;
    }

    public void setJsList(List<Js> jsList) {
        this.jsList = jsList;
    }

    public List<Gsjg> getGsjgList() {
        return gsjgList;
    }

    public void setGsjgList(List<Gsjg> gsjgList) {
        this.gsjgList = gsjgList;
    }
}
